import 'package:flutter_common_fragement/common/base/index.dart';
import 'package:flutter_common_fragement/components/common/my_list_view.dart';
import 'package:flutter_common_fragement/pages/root/test/test.dart';
import 'package:flutter_common_fragement/pages/root/view_model/hall_view_model.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class HallPage extends BasePage<HallViewModel> {
  HallPage() : super(HallViewModel());

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }

  @override
  void dispose() {
    // TODO: implement dispose
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: ConsumerWidget<HallViewModel>(
        isMock: true,
        builder: (context, vm, _) {
          return MyListView<HallViewModel>(
            viewModel: vm,
            child: ListView.builder(
              itemCount: 10,
              itemBuilder: (context, index) {
                return GestureDetector(
                  onTap: () {
                    vm.push(TestPage());
                  },
                  child: Container(
                    padding: EdgeInsets.symmetric(vertical: 10.h),
                    margin: EdgeInsets.only(bottom: 10.h),
                    width: double.infinity,
                    height: 50.h,
                    color: Colors.amber,
                    child: Container(
                      alignment: Alignment.center,
                      child: Text('${index + 1} 点击 set'),
                    ),
                  ),
                );
              },
            ),
          );
        },
      ),
    );
  }
}
